home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / lang / small304.lha / Smalltalk / src / env.h < prev    next >
C/C++ Source or Header  |  1993-05-08  |  4KB  |  208 lines

  1. /*
  2.     Little Smalltalk, version two
  3.     Written by Tim Budd, Oregon State University, July 1987
  4.  
  5.     environmental factors
  6.  
  7.     This include file gathers together environmental factors that
  8.     are likely to change from one C compiler to another, or from
  9.     one system to another.  Please refer to the installation 
  10.     notes for more information.
  11.  
  12.     for systems using the Make utility, the system name is set
  13.     by the make script.
  14.     other systems (such as the Mac) should put a define statement
  15.     at the beginning of the file, as shown below
  16. */
  17.  
  18. /*
  19. systems that don't use the Make utility should do something like this:
  20. # define LIGHTC
  21. */
  22.  
  23. /*=============== rules for various systems ====================*/
  24.  
  25. # ifdef B42
  26.     /* Berkeley 4.2, 4.3 and compatible running tty interface */
  27.         /*   which include: */
  28.         /* sequent balance */
  29.         /* Harris HCX-7 */
  30.         /* sun workstations */
  31.  
  32. typedef unsigned char byte;
  33.  
  34. # define byteToInt(b) (b)
  35.  
  36. /* this is a bit sloppy - but it works */
  37. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  38.  
  39. # define STRINGS
  40. # define SIGNAL
  41.  
  42. # endif
  43.  
  44. # ifdef SYSV
  45.     /* system V systems including: */
  46.     /*    HP-UX for the HP-9000 series */
  47.     /*     TEK 4404 with some modifications (see install.ms) */
  48.  
  49. typedef unsigned char byte;
  50.  
  51. # define byteToInt(b) (b)
  52.  
  53. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  54.  
  55. # define STRING
  56.  
  57. # endif
  58.  
  59. # ifdef TURBOC
  60.     /* IBM PC and compatiables using the TURBO C compiler */
  61.     
  62.     /* there are also changes that have to be made to the 
  63.         smalltalk source; see installation notes for
  64.         details */
  65.  
  66. typedef unsigned char byte;
  67.  
  68. # define byteToInt(b) (b)
  69.  
  70. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  71.  
  72. # define STRING
  73. # define ALLOC
  74. # define BINREADWRITE
  75. # define CTRLBRK
  76. # define PROTO
  77. # define obtalloc(x,y) (struct objectStruct huge *) farcalloc((unsigned long) x, (unsigned long) y)
  78.  
  79. #endif
  80.  
  81. # ifdef ATARI
  82.     /* Atari st 1040 - still exprimental */
  83.     
  84. typedef unsigned char byte;
  85.  
  86. # define byteToInt(b) (b)
  87.  
  88. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  89.  
  90. # define STRING
  91. # define ALLOC
  92. # define BINREADWRITE
  93. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  94.  
  95. #endif
  96.  
  97. # ifdef AZTEC_C
  98.     /* Amiga w/Manx Aztec C 5.2a - still exprimental */
  99.     
  100. typedef unsigned char byte;
  101.  
  102. # define byteToInt(b) (b)
  103.  
  104. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  105.  
  106. # define STRING
  107. # define BINREADWRITE
  108. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  109. # define system(x) Execute(x, 0L, 0L)
  110.  
  111. #endif
  112.  
  113. # ifdef LIGHTC
  114.         /* Macintosh using Lightspeed C compiler */
  115.         /* see install.ms for other changes */
  116.  
  117. typedef unsigned char byte;
  118.  
  119. # define byteToInt(b) (b)
  120.  
  121. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  122.  
  123. # define STRINGS
  124. # define BINREADWRITE
  125. # define STDWIN
  126. # define NOARGC
  127. # define PROTO
  128. # define NOSYSTEM
  129. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  130.  
  131. # endif
  132.  
  133. # ifdef VMS 
  134.     /* VAX VMS */
  135.  
  136. typedef unsigned char byte;
  137.  
  138. # define byteToInt(b) (b)
  139.  
  140. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  141.  
  142. # define STRING
  143. # define NOARGC
  144.  
  145. # endif
  146.  
  147. /* ======== various defines that should work on all systems ==== */
  148.  
  149. # define streq(a,b) (strcmp(a,b) == 0)
  150.  
  151. # define true 1
  152. # define false 0
  153.  
  154.     /* define the datatype boolean */
  155. # ifdef NOTYPEDEF
  156. # define boolean int
  157. # endif
  158. # ifndef NOTYPEDEF
  159. typedef int boolean;
  160. # endif
  161.  
  162.     /* define a bit of lint silencing */
  163.     /*  ignore means ``i know this function returns something,
  164.         but I really, really do mean to ignore it */
  165. # ifdef NOVOID
  166. # define ignore
  167. # define noreturn
  168. # define void int
  169. # endif
  170. # ifndef NOVOID
  171. # define ignore (void)
  172. # define noreturn void
  173. # endif
  174.  
  175. /* prototypes are another problem.  If they are available, they should be
  176. used; but if they are not available their use will cause compiler errors.
  177. To get around this we define a lot of symbols which become nothing if
  178. prototypes aren't available */
  179. # ifdef PROTO
  180.  
  181. # define X ,
  182. # define OBJ object
  183. # define OBJP object *
  184. # define INT int
  185. # define BOOL boolean
  186. # define STR char *
  187. # define FLOAT double
  188. # define NOARGS void
  189. # define FILEP FILE *
  190. # define FUNC ()
  191.  
  192. # endif
  193.  
  194. # ifndef PROTO
  195.  
  196. # define X
  197. # define OBJ
  198. # define OBJP
  199. # define INT
  200. # define BOOL
  201. # define STR
  202. # define FLOAT
  203. # define NOARGS
  204. # define FILEP
  205. # define FUNC
  206.  
  207. # endif
  208.